package com.correo.database.beans;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;

import javax.swing.DefaultComboBoxModel;

import com.correo.vista.server.windows.ventanasInternas.ComboTablas;

public class UserBean implements DataBaseBean,IBean{

    private String id;
    private String pasword;
    private String description;
    private Timestamp updateDate;
    private Timestamp createDate;
    private String name;
    private String apellido;
    
    private CasillaCorreoBean cassillaCorreo;
    private Set<CasillaCorreoBean>	listaCasillas;
    

    public UserBean () {
    	listaCasillas = new LinkedHashSet<CasillaCorreoBean>();
    }
    public String toString(){
    	return id;
    }
    public UserBean(String Id)
    {
    	this.id = Id;
    }

    public UserBean(String usuario, String password) {
		id=usuario;
		apellido = password;
	}
	public CasillaCorreoBean getCassillaCorreo () {
		if(listaCasillas!=null){
			if(listaCasillas.iterator().hasNext()){
				cassillaCorreo = listaCasillas.iterator().next();
			}
		}
        return cassillaCorreo;
    }

    public void setCassillaCorreo (CasillaCorreoBean val) {
        this.cassillaCorreo = val;
    }

    public Timestamp getCreateDate () {
        return createDate;
    }

    public void setCreateDate (Timestamp val) {
        this.createDate = val;
    }

    public String getDescription () {
        return description;
    }

    public void setDescription (String val) {
        this.description = val;
    }

    public String getId () {
        return id;
    }

    public void setId (String val) {
        this.id = val;
    }

    public String getPasword () {
        return pasword;
    }

    public void setPasword (String val) {
        this.pasword = val;
    }


    public Timestamp getUpdateDate () {
        return updateDate;
    }

    public void setUpdateDate (Timestamp val) {
        this.updateDate = val;
    }

   

	public String getCampos() {
		// TODO Auto-generated method stub
		return null;
	}

	public String getCondicion() {
		// TODO Auto-generated method stub
		return null;
	}

	public DataBaseBean getDataBean(ResultSet result) {
		// TODO Auto-generated method stub
		return null;
	}

	public String getOrderBy() {
		// TODO Auto-generated method stub
		return null;
	}

	public String getTableName() {
		// TODO Auto-generated method stub
		return null;
	}

	public void setPreparedCampo(PreparedStatement preparedStatement) {
		// TODO Auto-generated method stub
		
	}

	public void setPreparedCondicion(PreparedStatement preparedStatement) {
		// TODO Auto-generated method stub
		
	}

	public void setPreparedOrderBy(PreparedStatement preparedStatement) {
		// TODO Auto-generated method stub
		
	}

	public void setPreparedTableName(PreparedStatement preparedStatement) {
		// TODO Auto-generated method stub
		
	}

	public String getInsert() {
		// TODO Auto-generated method stub
		return null;
	}

	public String getSelect() {
		// TODO Auto-generated method stub
		return null;
	}

	public void setPreparedSql(PreparedStatement preparedStatement) {
		// TODO Auto-generated method stub
		
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getApellido() {
		return apellido;
	}
	public void setApellido(String apellido) {
		this.apellido = apellido;
	}
	public Set<CasillaCorreoBean> getListaCasillas() {
		return listaCasillas;
	}
	public void setListaCasillas(Set<CasillaCorreoBean> listaCasillas) {
		this.listaCasillas = listaCasillas;
	}
	public ComboTablas getCombo() {
		ComboTablas combo = new ComboTablas();
		if(listaCasillas!=null){
			Iterator<CasillaCorreoBean> it=listaCasillas.iterator();
			while(it.hasNext()){
				((DefaultComboBoxModel)combo.getModel()).addElement(it.next());
			}
		}
		
		return combo;
	}

}

